/*
 * @Author: your name
 * @Date: 2020-07-29 10:37:30
 * @LastEditTime: 2020-07-31 17:41:05
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \dcg-vue-init\src\test\index.js
 */

// 基于 require.context 自动注册

const files = require.context('.', false, /\.js$/)
// console.log(require.context('.', false, /\.js$/))

// console.log('------>files: ', files)
// console.log('----->files.keys(): ', files.keys())

// console.log( '----->files.keys(): ',
files.keys().filter(key => key !== './index.js')
// )

const configArr = []
const arr = files.keys().filter(key => key !== './index.js')

arr.forEach(v => {
  console.log('file-v:', files(v))
  configArr.push(files(v).default)
})

configArr.sort((a, b) => a.sort - b.sort)
// console.log(configArr)
